package com.fury.framework;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.fury.managers.TaskManager;

public class Scheduler {
	private final List<FurySystem> systems;
	private final TaskManager taskManager;
	private final List<List<Task>> taskBuffer;

	public Scheduler() {
		systems = new ArrayList<FurySystem>();
		taskManager = TaskManager.getInstance();
		taskBuffer = taskManager.getBuffer();
	}
	
	public void addSystem(FurySystem system) throws FuryException {
		taskBuffer.add(system.getTasks());
		systems.add(system);
	}
	
	public void tick() {
		taskManager.processTasks();
	}

}
